<template>
  <div class="caiji">
    <div class="caiji_left">
      <div class="order_box">
        <div class="order_box_num">
          <p>事件采集：</p>
          <div class="order_span flex flex-end">
            <img :src="img1" alt class="img1" />
            <img :src="img2" alt class="img2" />
            <img :src="img3" alt class="img3" />
            <img :src="img4" alt class="img4" />
            <div class="span_box flex">
              <span :key="index" v-for="(item, index) in statisticsData.cj.split('')">
                <count-to :startVal='0' :endVal="Number(item)" :duration='1000'></count-to>
              </span>
            </div>
          </div>
        </div>

        <div class="order_box_num">
          <p>本年度受理采集案件量：</p>
          <div class="order_span flex flex-end">
            <img :src="img1" alt class="img1" />
            <img :src="img2" alt class="img2" />
            <img :src="img3" alt class="img3" />
            <img :src="img4" alt class="img4" />
            <div class="span_box flex">
              <span :key="index" v-for="(item, index) in statisticsData.yearCj.split('')">
                <count-to :startVal='0' :endVal="Number(item)" :duration='1000'></count-to>
              </span>
            </div>
          </div>
        </div>

        <div class="order_box_num">
          <p>本月度受理采集案件量：</p>
          <div class="order_span flex flex-end">
            <img :src="img1" alt class="img1" />
            <img :src="img2" alt class="img2" />
            <img :src="img3" alt class="img3" />
            <img :src="img4" alt class="img4" />
            <div class="span_box flex">
              <span :key="index" v-for="(item, index) in statisticsData.monthCj.split('')">
                <count-to :startVal='0' :endVal="Number(item)" :duration='1000'></count-to>
              </span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="caiji_right">
      <div class="caiji_right_list">
        <div class="caiji_right_list_text">
          <span>门头报审总量</span>
          <img alt src="@/assets/images/home/gengduo.png" />
        </div>
        <div class="caiji_right_list_num">
          <p>
            <span>{{ statisticsData.storeNum || 0}}</span>
            <!-- <count-to :startVal='0' :endVal='statisticsData.storeNum' :duration='2000'></count-to> -->
            <span>件</span>
          </p>
          <p>{{ statisticsData.storeNum }}%</p>
        </div>
      </div>
      <div class="caiji_right_list">
        <div class="caiji_right_list_text">
          <span>商业庆典总量</span>
          <img alt src="@/assets/images/home/gengduo.png" />
        </div>
        <div class="caiji_right_list_num">
          <p>
            <span>{{ statisticsData.activeNum || 0}}</span>
            <!-- <count-to :startVal='0' :endVal='statisticsData.storeNum' :duration='2000'></count-to> -->
            <span>件</span>
          </p>
          <p>{{ statisticsData.activeNum }}%</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { HomeDb } from '@/api'
import countTo from 'vue-count-to';
export default {
  data() {
    return {
      statisticsData: {
        month: 0, //本月案件数量
        year: 0, //本年案件数量
        qita: 0, //其他类型案件数量
        qitaRate: 0,
        shuzichengguan: 0, //数字城管案件数量
        shuzichengguanRate: 0,
        bianmingrexian: 0, //便民服务案件数量
        bianmingrexianRate: 0
      },
      img1: require('@/assets/images/content/span1.png'),
      img2: require('@/assets/images/content/span2.png'),
      img3: require('@/assets/images/content/span3.png'),
      img4: require('@/assets/images/content/span4.png')
    }
  },
  components: {
    countTo
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      // 受理案件统计
      HomeDb.getStatisticsOrderNum().then(res => {
        // const total = res.data[0].qita + res.data[0].shuzichengguan + res.data[0].bianmingrexian
        this.$nextTick(() => {
          this.statisticsData = {...res.data}
        })
      })
    }
  }
}
</script>

<style lang="less" scoped>
.caiji {
  width: 100%;
  display: flex;
  justify-content: space-between;

  &_left {
    width: 264px;
    height: 350px;
    // box-shadow: 0px 0px 12px 4px rgba(14,184,255,0.36);
    background: url('../../../assets/images/home/bg2.png') no-repeat;
    background-size: 100% 100%;
    padding: 40px 35px;

    // opacity: 0.6;
    .order_box {
      margin-bottom: 30px;

      p {
        font-size: 16px;
        font-family: Noto Sans S Chinese;
        font-weight: 400;
        font-style: italic;
        color: #9ed5ff;
        text-align: right;
        margin-bottom: 10px;
      }

      .order_box_num {
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        align-items: flex-end;

        .order_span {
          // width: auto;
          height: 42px;
          border: 1px solid rgba(59, 255, 255, 0.2);
          padding: 5px;
          position: relative;

          .span_box {
            span {
              width: 24px;
              height: 32px;
              background: url('../../../assets/images/content/spanbj.png') no-repeat;
              background-size: 24px 32px;
              font-size: 24px;
              font-family: Microsoft YaHei;
              color: #21d3ff;
              text-align: center;
              line-height: 32px;
              margin-right: 5px;
              display: block;
            }

            span:last-child {
              margin-right: 0;
            }
          }
        }
      }

      img {
        width: 6px;
        height: 6px;
        position: absolute;
      }

      .img1 {
        top: -2px;
        left: -2px;
      }

      .img2 {
        top: -2px;
        right: -2px;
      }

      .img3 {
        bottom: -2px;
        left: -2px;
      }

      .img4 {
        bottom: -2px;
        right: -2px;
      }
    }
  }

  &_right {
    width: 220px;
    padding-top: 18px;
    // display: flex;
    

    &_list {
      width: 100%;
      background: url('../../../assets/images/home/bg1.png') no-repeat;
      background-size: 100% 100%;
      padding: 8px 16px;
      margin-bottom: 4px;

      &_text {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        span {
          display: inline-block;
          font-size: 14px;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #9ed5ff;
        }

        img {
          display: inline-block;
          width: 25px;
          height: 6px;
        }
      }

      &_num {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 8px;

        p:nth-child(1) {
          span:nth-child(1) {
            font-size: 25px;
            font-family: DIN;
            font-weight: bold;
            color: #bef0ff;
            line-height: 25px;
          }

          span:nth-child(2) {
            font-size: 12px;
            font-family: Adobe Heiti Std;
            font-weight: normal;
            color: #bef0ff;
          }
        }

        p:nth-child(2) {
          font-size: 14px;
          font-family: DIN;
          font-weight: bold;
          color: #32edaa;
          margin-top: 10px;
        }
      }
    }
  }
}
</style>
